PriceInfo.prototype = {
  reset: function () {
	  this.ticketCount = 0
	  this.price = 0
	  this.parValue = 0
	  this.tax = 0
	  this.insurance = 0
	  this.serviceCharge = 0
	  this.commission = 0
	  this.commission2 = 0
	  this.discount = 0
	  this.amount = 0
	  this.cost = 0
	  this.profit = 0
	  this.totalAmount = 0
	  this.totalCost = 0
	  this.totalProfit = 0  	
  }, 
  calc: function () {
    this.cost = this.parValue + this.tax + this.insurance - this.commission - this.commission2
    this.totalCost = this.cost * this.ticketCount

    this.amount = this.parValue + this.tax + this.insurance + this.serviceCharge - this.discount
    this.totalAmount = this.amount * this.ticketCount
    this.calcProfit()
  },
  calcProfit: function () {
    this.profit = this.mathRound(this.commission + this.commission2 + this.serviceCharge - this.discount)
    this.totalProfit = this.mathRound(this.profit * this.ticketCount)
  },
  mathRound: function (val) {
	return Math.round(val * 100) / 100
  }
}

function PriceInfo () {
	this.reset()
};

// module.exports = dateFunc;
export default PriceInfo
